package com.yunke.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 定时任务实体类
 * 
 * @author yunke
 * @since 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("yunke_schedule_job")
@Schema(name = "YunkeScheduleJob", description = "定时任务实体")
public class YunkeScheduleJob implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "任务ID")
    private Long id;

    @Schema(description = "任务名称")
    private String jobName;

    @Schema(description = "任务编码")
    private String jobCode;

    @Schema(description = "任务组")
    private String jobGroup;

    @Schema(description = "任务类名")
    private String jobClass;

    @Schema(description = "任务方法")
    private String jobMethod;

    @Schema(description = "任务参数")
    private String jobParams;

    @Schema(description = "Cron表达式")
    private String cronExpression;

    @Schema(description = "任务类型（1系统任务 2业务任务 3清理任务）")
    private Integer jobType;

    @Schema(description = "任务状态（0停止 1运行 2暂停）")
    private Integer jobStatus;

    @Schema(description = "执行策略（1立即执行 2等待执行 3放弃执行）")
    private Integer executeStrategy;

    @Schema(description = "并发执行（0禁止 1允许）")
    private Boolean concurrent;

    @Schema(description = "失败重试次数")
    private Integer retryCount;

    @Schema(description = "超时时间（毫秒）")
    private Long timeout;

    @Schema(description = "任务描述")
    private String jobDesc;

    @Schema(description = "下次执行时间")
    private Long nextFireTime;

    @Schema(description = "上次执行时间")
    private Long prevFireTime;

    @Schema(description = "执行次数")
    private Integer executeCount;

    @Schema(description = "失败次数")
    private Integer failCount;

    @Schema(description = "成功次数")
    private Integer successCount;

    @Schema(description = "最后执行结果")
    private String lastResult;

    @Schema(description = "最后执行时长（毫秒）")
    private Long lastDuration;

    @Schema(description = "创建用户ID")
    private Long createUserId;

    @Schema(description = "创建用户名")
    private String createUserName;

    @Schema(description = "扩展信息（JSON格式）")
    private String extraInfo;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "状态（0正常 1删除）")
    private Integer status;

    @Schema(description = "创建时间")
    private Long createTime;

    @Schema(description = "更新时间")
    private Long updateTime;
} 